package tech.yunland.shop.domain.dao;

import com.moyuer.bsf.domain.dao.BaseDao;
import org.springframework.stereotype.Repository;
import tech.yunland.shop.domain.model.PurchaseBill;

import java.util.List;
import java.util.Map;

/**
 * 采购单
 *
 * @author 文卡<wkwenka@gmail.com>  on 17-2-13.
 */

@Repository
public class PurchaseBillDao extends BaseDao<PurchaseBill, String> {

    /**
     * 读取进入流程的采购单信息
     *
     * @return
     */
    public List<Map<String, Object>> getPurchaseBillList() {

        StringBuffer buffer = new StringBuffer();
        buffer.append("SELECT pb.id,pd.sn,pd.bizdate,pd.state FROM purchase_bill pb WHERE pb.id In");
        buffer.append("(SELECT act_re.business_key_ FROM act_ru_execution act_re " +
                "LEFT JOIN act_ru_task act_rt ON act_rt.execution_id_ = act_re.id_ " +
                "WHERE act_re.business_key_ IS NOT NULL)");

        return null;
    }
}

